package com.overlord.im.connector.message.service;

import com.overlord.im.commons.message.OverlordImMessage;
import com.overlord.im.connector.mq.sender.RedirectMessageRabbitMqSender;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName RedirectMessageService
 * @Author wuwei
 * @Description NONE
 * @Date 2020/6/1 10:49
 **/
@Service
public class SendMessageService {

    @Resource
    private RedirectMessageRabbitMqSender redirectMessageRabbitMqSender;

    /**
     * 无论接收方是否连接在本机，都发送到server节点去处理
     *
     * @param message
     * @param ctx
     */
    public void send(OverlordImMessage message, ChannelHandlerContext ctx) {
        //发送到server端去处理
        redirectMessageRabbitMqSender.send(message);
    }

}
